#include <p18f46k22.h>
#include "LCD.h"

#pragma config FOSC = INTIO67
#pragma config WDTEN = OFF, LVP = OFF//,MCLRE = OFF
#pragma code

void InterruptServiceHigh (void);
void InterruptServiceLow (void);

// High priority interrupt vector
#pragma code InterruptVectorHigh = 0x08
void InterruptVectorHigh (void)
{
	_asm
	goto InterruptServiceHigh //jump to interrupt routine
	_endasm
}

// Low priority interrupt vector
#pragma code InterruptVectorLow = 0x18
void InterruptVectorLow (void)
{
	_asm
	goto InterruptServiceLow //jump to interrupt routine
	_endasm
}

// High priority interrupt routine

#pragma interrupt InterruptServiceHigh
void InterruptServiceHigh(void)
{	
	
}

#pragma interruptlow InterruptServiceLow
void InterruptServiceLow(void)
{
	
}

void main(void){
	ANSELD &= 0x00;	
	ANSELE &= 0x07;
	TRISEbits.RE0 = 0;	//LCD RS
	TRISEbits.RE1 = 0;	//LCD R/W
	TRISEbits.RE2 = 0;	//LCD E
	TRISDbits.RD0 = 0;	//LCD DATA0
	TRISDbits.RD1 = 0;	//LCD DATA1
	TRISDbits.RD2 = 0;	//LCD DATA2
	TRISDbits.RD3 = 0;	//LCD DATA3
	LATEbits.LATE1=0;
	LATEbits.LATE0=0;		
	LATEbits.LATE2=0;
	LCD2X16_init();LCD2X16_setCursor(1,1);
	LCD2X16_putChar('V');
	LCD2X16_putChar('a');
	LCD2X16_putChar('l');
	LCD2X16_putChar('i');
	LCD2X16_putChar('d');
	LCD2X16_putChar('e');
	LCD2X16_putChar('?');
	LCD2X16_setCursor(1,2);
	LCD2X16_putChar('N');
	LCD2X16_putChar('b');
	LCD2X16_putChar(' ');
	LCD2X16_putChar('G');
	LCD2X16_putChar('P');
	LCD2X16_putChar('S');
	LCD2X16_putChar(':');
	while(1){
	}
}